const Users = require('../models/Users');


const getUser = async (query) => {
    try {
        const user = await Users.findOne(query).select('+password');
        if (!user || !user.status) {
            throw Error('未找到用户或未激活');
        }

        return user;
    } catch (err) {
        throw Error(err);
    }
};




module.exports = {
    getUser
};
